#include <project.h>
#include "userMain.h"
#include "userClockTimerTick.h"

#define USER_CLOCK_TEST
void userClockMainTickTestFunc(void);
void userClockSubTickTestFunc(void);

unsigned char userDelayCnt = 0;
extern uint16 userStartCnt;
extern uint8 timerzero ;

void userClockMainTickTestFunc(void)
{
#ifdef	USER_CLOCK_TEST
	static unsigned char TestFlag = 0;
	if(TestFlag)
	{
		TestFlag = 0;
        //RELAY_Write(0);
	}
	else
	{	
		TestFlag = 1;
        //RELAY_Write(7);
    }
#endif
}

void userClockMainTickFunc(void)
{
    userClockMainTickTestFunc();
    //userCapsenseAdcFunc();
    userKeyScanTimerTick();
    userLedTickFunc();
    userMotionMarkTickFunc();
    //userNightPwmFunc();
    userBeepMarkTickFunc();
    userRelayChangeTickFunc();
    //userBeepPwm();
    userDelayCnt--;
    userStartCnt++;
	if(timerzero<200)timerzero++;
    userBackLedChangeFunc();
    userBackLightHumanSetFunc();
    userRelayPowerSetFunc();
    userUartRxFinishTick();
    userUartTxFinishTick();
}

void userDelay10ms(unsigned char delayCnt)
{
    userDelayCnt = delayCnt;
    while(userDelayCnt != 0)
    {
       _NOP;
    }
}

/*****************END OF FILE****************/
